//
//  RYLocationView.swift
//  SheYangBigData
//
//  Created by 宋海胜 on 2021/1/14.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit

class RYLocationView: SYBaseView {

    let nameLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 14.autoFontSize()
        
        return v
    }()
    
    let dizhiLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0xA6A6A6)
        v.font = 14.autoFontSize()
        
        v.numberOfLines = 0
        return v
    }()

    let location: UIImageView = {
        let v: UIImageView = UIImageView()
        v.image = UIImage(named: "location")
        return v
    }()
    
    func configure(_ model: RYDingdanModel) {
        nameLb.text = "\(model.adoptShippingAddressVO?.name ?? "") \(model.adoptShippingAddressVO?.mobile ?? "")"
        dizhiLb.text = "\(model.adoptShippingAddressVO?.provinceName ?? "")\(model.adoptShippingAddressVO?.cityName ?? "")\(model.adoptShippingAddressVO?.districtName ?? "")\(model.adoptShippingAddressVO?.streetName ?? "")\(model.adoptShippingAddressVO?.address ?? "")"
    }
    
    override func initViews() {
        
        addSubview(nameLb)
        addSubview(dizhiLb)
        addSubview(location)
        location.snp.makeConstraints { (make) in
            make.left.equalToSuperview()
            make.top.equalToSuperview()
            make.width.equalTo(11.autoWidth())
            make.height.equalTo(13.autoWidth())
        }
        nameLb.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(20.autoWidth())
            make.top.equalToSuperview()
            make.height.equalTo(15.autoWidth())
        }
        dizhiLb.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(20.autoWidth())
            make.right.equalToSuperview().offset(-20.autoWidth())
            make.top.equalToSuperview().offset(25.autoWidth())
            
        }
    }

}
